1. Field of the Invention
The present invention relates to a control system for a programmable controller which processes, via a program, sequence control of a numerically-controlled machine tool through utilization of a stored program system.
2. Description of the Related Art
Conventionally, a power circuit including a number of relays is interposed between a numerical control unit and a machine tool, and a predetermined one of the relays is activated by a command from the numerical control unit, thereby causing the machine element to perform an operation corresponding to the command. However, the provision of such a power circuit leads to defects in that the numerical control unit inevitably becomes bulky and costly because of the use of many relays. To avoid such defects, a programmable controller has come into wide use which implements the function of the power circuit through program processing.
In general, according to such a program controller, a sequence program of the ladder type is stored in a memory and a processor executes the sequence program, thereby performing sequence control of the machine. The ladder type sequence program is a program in which functions of the power circuit are logically programmed in terms of instruction codes. For example, the ladder type sequence program corresponding to the ladder diagram illustrated in FIG. 6, which shows a part of the power circuit indicated by relay contacts and relay coils, is such as shown in FIG. 7. Here, reference characters RD, OR, NOT, etc. respectively identify instruction codes, RD being a read-out instruction, AND an AND operation instruction, WRT a write instruction, OR an OR operation instruction, and OR NOT an instruction for an OR operation with a "not" value. Further, 10.0, 200.1, etc. are addresses (predetermined addresses, predetermined bits) in a data memory at which the instruction codes are executed. Via the execution of the instructions of the sequence program, a logical operation, (a.b)+c, is performed and the result of the operation ("1" or "0") is stored in a first bit of an address 210 of the data memory.
In terms an operation of the power circuit, a relay coil d is energized in accordance with the state of relay contacts a, b, and c.
The programmable controller generally performs logical operations under control of such a ladder type sequence program as mentioned above to effect sequence control of the machine, but sometimes it is necessary to conduct processes which are difficult to describe in the ladder type program language, such as four operations, an operation of a trigonometric function and time management. In anticipation of this, the conventional programmable controller is equipped with a memory which has stored therein a routine for four operations, a routine for time management, or the like described in a computer language such as PASCAL or FORTRAN, and is adapted to be capable of freely using the stored routine just like a subroutine of the ladder type program.
However, since the computer language which the prior art programmable controller is permitted to use for sequence control of the machine is limited only to the language stored in the memory, it is difficult to exercise complex sequence control of the machine in accordance with the internal state of the numerical control unit (for example, a process which performs an operation corresponding to the current position of the machine and branches the sequence according to the results of the operation). Moreover, since the contents of the memory cannot be modified by the user, there are cases where it is difficult to prepare the sequence program.